using System.Collections.Generic;
using System.Threading.Tasks;

using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Services;

namespace Leo.Core.Domain
{
    public interface IBaseDomainService<TRepository, TEntity, TKey> : IDomainService
        where TKey : struct
        where TEntity : class, IEntity<TKey>
        where TRepository : IBaseAbpRepository<TEntity, TKey>
    {
        Task<TEntity> InsertAsync(TEntity entity, bool autoSave = false);
        Task<TEntity> UpdateAsync(TEntity entity, bool autoSave = false);
        Task DeleteAsync(TEntity entity, bool autoSave = false);
        Task DeleteByIdAsync(TKey id, bool autoSave = false);
        Task<TEntity> GetAsync(TKey id);
        Task<TEntity> FindAsync(TKey id);
        Task<List<TEntity>> GetListByIdAsync(List<TKey> ids);
        Task<List<TEntity>> GetAllListAsync();
        Task InsertManyAsync(IEnumerable<TEntity> entities, bool autoSave = false);
        Task UpdateManyAsync(IEnumerable<TEntity> entities, bool autoSave = false);
        Task DeleteManyAsync(IEnumerable<TEntity> entities, bool autoSave = false);
    }
}
